﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.Entities.Mater
{
    //[Table("BS_MaterInfo")] // 指定数据库表名
    public class Mater_Info : BaseEntity<string>
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        public override string Id { get; set; }
        /// <summary>
        /// 物料编码
        /// </summary>
        public string? MaterCode { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        public string? MaterName { get; set; }

        /// <summary>
        /// 物料类型ID
        /// </summary>
        public string? MaterTepyID { get; set; }

        /// <summary>
        /// 物料类型名称
        /// </summary>
        public string? materTepyName { get; set; }

        /// <summary>
        /// 物料规格
        /// </summary>
        public string? MaterSpec { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string? Unit { get; set; }

        /// <summary>
        /// 标准成本
        /// </summary>
        public decimal? StandardCost { get; set; }

        /// <summary>
        /// 补货点
        /// </summary>
        public string? ReorderPoint { get; set; }

        /// <summary>
        /// 供应商ID
        /// </summary>
        public string? SupplierID { get; set; }
        public string? SupplierName { get; set; }

        /// <summary>
        /// 状态(10启用 20停用)
        /// </summary>
        public string? Status { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string? CreatedBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public string? CreateTime { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        public string? UpdateBy { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public string? UpdateTime { get; set; }

        /// <summary>
        /// 构造函数 - 自动生成GUID
        /// </summary>
        public Mater_Info()
        {
            // 如果ID为空，自动生成GUID
            if (string.IsNullOrEmpty(Id))
            {
                Id = Guid.NewGuid().ToString();
            }
        }
    }
}
